package com.healthcloud.service.impl;

import com.healthcloud.dao.losewisdom.LoseWisdomFollowUpDao;
import com.healthcloud.dto.req.losewisdom.LoseWisdomFollowUpListReq;
import com.healthcloud.entity.losewisdom.LoseWisdomFollowUpEntity;
import com.healthcloud.service.losewisdom.LoseWisdomFollowUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.healthcloud.utils.PageParam;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service("loseWisdomFollowUpService")
@Transactional
public class LoseWisdomFollowUpServiceImpl implements LoseWisdomFollowUpService {

	@Autowired
	private LoseWisdomFollowUpDao loseWisdomFollowUpDao;
	
	@Override
	public LoseWisdomFollowUpEntity queryObject(Integer id){
		return loseWisdomFollowUpDao.queryObject(id);
	}

	/**
	 * 获取随访列表数据
	 * @param req
	 * @param pageParam
	 * @return
	 */
	@Override
	public List<LoseWisdomFollowUpEntity> queryList(LoseWisdomFollowUpListReq req, PageParam pageParam){
		return loseWisdomFollowUpDao.queryList(req, pageParam);
	}
	
	@Override
	public int queryTotal(LoseWisdomFollowUpListReq bean){
		return loseWisdomFollowUpDao.queryTotal(bean);
	}


	@Override
	public void save(LoseWisdomFollowUpEntity loseWisdomFollowUp){
		loseWisdomFollowUp.setCreateTime(new Date());
		loseWisdomFollowUpDao.save(loseWisdomFollowUp);
	}
	
	@Override
	public void update(LoseWisdomFollowUpEntity loseWisdomFollowUp){
		loseWisdomFollowUp.setUpdateTime(new Date());
		loseWisdomFollowUpDao.update(loseWisdomFollowUp);
	}
	
	@Override
	public void delete(Integer id){
		loseWisdomFollowUpDao.delete(id);
	}
	
	@Override
	public void deleteBatch(Integer[] ids){
		loseWisdomFollowUpDao.deleteBatch(ids);
	}
	
}
